"""
乖乖地正常分析
"""
# %%
import torch
from torch import nn, Tensor, optim
from torch.autograd import Variable
import torch.nn.functional as F
from typing import (
    TypeVar, Type, Union, Optional, Any,
    List, Dict, Tuple, Callable, NamedTuple
)

import numpy as np

import random
import time
import os
import copy
import re
import logging
from concurrent.futures import ThreadPoolExecutor
from concurrent import futures
import itertools

from utils import Args, D, timeit
from exp_tools import (
    Sample, RawDataSet, read_data, calc_accuracy
)

logger = logging.getLogger(__name__)


def get_args() -> Args:
    """
    获取参数
    """
    default_data_dir = os.path.join(os.path.dirname(
        __file__), "dataset/traffic")
    return Args([
        D("batchSize", int, 32),
        D("learningRate", float, 1e-3),
        D("numEpochs", int, 5000),
        D("dataDir", str, default_data_dir),
        D("saveDir", str, None),
        D("nClass", int, 50),
    ])


# %%
args = get_args()

batch_size = args.batchSize  # 批的大小
learning_rate = args.learningRate  # 学习率
num_epochs = args.numEpochs  # 遍历训练集的次数
data_dir = args.dataDir
save_dir = args.saveDir
n_class = args.nClass


# %%
logger.info("--- 读取数据 ---")
with timeit(logger):
    # dataset = read_data(data_dir, num_train=6, num_test=6)
    dataset = read_data(data_dir)
logger.info("--- 数据读取完成 ---")

print("over")
